/*****************************************************************************
* University of Southern Denmark
* Embedded Programming (EMP)
*
* MODULENAME.: uart.h
*
* PROJECT....: Assignment 7
*
* DESCRIPTION: See module specification file (.h-file).
*
* Change Log:
******************************************************************************
* Date    Id    Change
* YYMMDD
* --------------------
* 120406  AP    Module created.
*
*****************************************************************************/

#ifndef UART_H_
#define UART_H_

/***************************** Include files *******************************/
#include "FreeRTOS.h"
#include "Task.h"
#include "queue.h"
#include "semphr.h"
#include "..\inc\ecp_type.h"
/*****************************    Defines    *******************************/
xQueueHandle read_buffer; // Holds received data to UART
xSemaphoreHandle read_buffer_mutex; // Mutex to lock the received data queue
xQueueHandle send_buffer; // Holds data to sent
xSemaphoreHandle send_buffer_mutex; // Mutex to lock the send data queue
/*****************************   Constants   *******************************/

/*****************************   Functions   *******************************/

void init_UART(void);
/*****************************************************************************
*   Input    : -
*   Output   : -
*   Function : Initialize UART settings
******************************************************************************/
void send_task(void* pvParameters);
/*****************************************************************************
*   Input    : -
*   Output   : -
*   Function : send_task, this task sends data from the UART.
******************************************************************************/
void receive_task(void* pvParameters);
/*****************************************************************************
*   Input    : -
*   Output   : -
*   Function : receive_task, this task receives data from the UART.
******************************************************************************/

/****************************** End Of Module *******************************/
#endif /* UART_H_ */
